/*******************************************************************************
 * @file Copyright 2009 The CREATE Lab at CMU
 * 
 *       This file is part of JubJub, an open source project.
 *       http://code.google.com/p/jubjub/
 * 
 *       Redistribution and use in source and binary forms, with or without
 *       modification, are permitted provided that the following conditions are
 *       met:
 * 
 *       Redistributions of source code must retain the above copyright notice,
 *       this list of conditions and the following disclaimer.
 * 
 *       Redistributions in binary form must reproduce the above copyright
 *       notice, this list of conditions and the following disclaimer in the
 *       documentation and/or other materials provided with the distribution.
 * 
 *       Neither the name of Carnegie Mellon nor the names of its contributors
 *       may be used to endorse or promote products derived from this software
 *       without specific prior written permission.
 * 
 *       THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 *       "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 *       LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
 *       PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
 *       HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 *       SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 *       LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 *       DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 *       THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 *       (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 *       OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 *******************************************************************************/

package edu.cmu.ri.createlab.jj.blocks;

/**
 * 
 * @author Erik Pasternak
 *
 * These are definitions that relate to blocks, such as the types of blocks or ways
 * to access blocks. 
 */
public class BlockDefs
{
   ///All the existing types of blocks. There should be a visitor and a Class for
   ///each type of block listed.
   public enum BlockTypes
   {
      BLOCK("BlockBlock"),
      CODE("CodeBlock"),
      FLOW("FlowBlock"),
      EXPRESSION("ExpressionBlock"),
      VAR("VarBlock"),
      OBJECT("ObjectBlock"),
      COMMENT("CommentBlock");
      String str;
      
      private BlockTypes(String s)
      {
         str = s;
      }
      public String toString()
      {
         return str;
      }
   }
   
   ///This is a list of all the types of variables supported. Currently this list
   ///supports Java types. Objects have special considerations.
   public enum VarTypes
   {
      BYTE("byte"),
      SHORT("short"),
      INT("int"),
      LONG("long"),
      FLOAT("float"),
      DOUBLE("double"),
      BOOLEAN("boolean"),
      CHAR("char"),
      OBJECT("object");
      String str;
      
      private VarTypes(String str)
      {
         this.str = str;
      }
      
      public String toString()
      {
         return str;
      }
   }
   
   ///Supported flow control types
   public enum FlowTypes
   {
      IF,
      IFELSE,
      WHILE,
      FOR,
      //SWITCH
   }
   
   ///The ExpressionBlock types supported. These mostly affect how they can be used.
   public enum ExpressTypes
   {
      ASSIGN,
      ARITH,
      LOGIC
   }
   
   ///Different keywords for accessing variables/methods. Currently java keywords
   ///are supported. In future code this should probably be moved to the editor.
   public enum AccessTypes
   {
      PUBLIC(0),
      PRIVATE(1),
      PROTECTED(2),
      FINAL(3),
      STATIC(4);
      
      private int index;
      private AccessTypes(int val)
      {
    	  index = val;
      }
      
      public int getIndex()
      {
    	  return index;
      }
   }
   
   ///The different ways of inserting code, either as a call to a subroutine
   ///or by copying the full contents of the code.
   public enum CallTypes
   {
      INLINE,
      METHOD
   }

}
